package per.joker;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.SQLException;

/**
 * @author joker
 * @date 2022/5/12 0012 - 23:42
 */
//@Component
public class Test05 {
    @Autowired
    public Test04 test04;
    static ApplicationContext ioc = new ClassPathXmlApplicationContext("ioc.xml");
    public static void main(String[] args) throws SQLException {
//        DataSource dataSource = ioc.getBean(DataSource.class);
//        Connection connection = dataSource.getConnection();
//        String sql="insert into admin(user_name,pwd) values(?,?)";
//        PreparedStatement ps = connection.prepareStatement(sql);
//        ps.setString(1,"李四");
//        ps.setString(2,"123456");
//        ps.execute();
//        connection.close();

//        Test05 test05 = new Test05();
//        test05.t2();
//        Test04 test04 = ioc.getBean("test04",Test04.class);
//        test04.t1();
//        Test05 test05 = new Test05();
//        test05.test04.t1();
    }
//    public void t2(){
//        test04.t1();
//    }
}
